package cn.maszy.action.projectmanagement;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import cn.maszy.common.BaseAction;
import cn.maszy.common.Pager;
import cn.maszy.model.projectmanagement.C_T_Sys_FileType;
import cn.maszy.service.projectmanagement.C_T_Sys_FileTypeService;

public class FileTypeAction extends BaseAction<C_T_Sys_FileType>{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Autowired
	private  C_T_Sys_FileTypeService c_T_Sys_FileTypeService;
	private C_T_Sys_FileType c_T_Sys_FileType;
	private List<C_T_Sys_FileType> list_C_T_Sys_FileType;
	private String checkIds;
	private String moduleName;
	private String flag;
	//项目ID
	private String projectUuid;
	//辅助ID
	private String auxiliaryId;
	/*********************class set/get****************************/
	public String getCheckIds() {
		return checkIds;
	}
	public void setCheckIds(String checkIds) {
		this.checkIds = checkIds;
	}
	public C_T_Sys_FileType getC_T_Sys_FileType() {
		return c_T_Sys_FileType;
	}
	public void setC_T_Sys_FileType(C_T_Sys_FileType c_T_Sys_FileType) {
		this.c_T_Sys_FileType = c_T_Sys_FileType;
	}
	public String getModuleName() {
		return moduleName;
	}
	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}
	public List<C_T_Sys_FileType> getList_C_T_Sys_FileType() {
		return list_C_T_Sys_FileType;
	}
	public void setList_C_T_Sys_FileType(
			List<C_T_Sys_FileType> list_C_T_Sys_FileType) {
		this.list_C_T_Sys_FileType = list_C_T_Sys_FileType;
	}
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}
	public String getProjectUuid() {
		return projectUuid;
	}
	public void setProjectUuid(String projectUuid) {
		this.projectUuid = projectUuid;
	}
	public String getAuxiliaryId() {
		return auxiliaryId;
	}
	public void setAuxiliaryId(String auxiliaryId) {
		this.auxiliaryId = auxiliaryId;
	}
	/*******************STRUTS ACTION METHOD*************************/
	/**
	 * 插入
	 */
	public String fileTypeUpdate()
	{
		int i=c_T_Sys_FileTypeService.update(c_T_Sys_FileType);
		if(i>0)
		return ajaxForwardSuccess(getText("msg.operation.success"), "fileTypeList","", "forward", "projectmanagement/fileTypeList");
		return ajaxForwardError(getText("msg.operation.failure"));
	}
	/**
	 * 查询
	 * @return
	 */

	public  String fileTypeList() 
	{
		pager = new Pager<C_T_Sys_FileType>(pageNum, numPerPage,orderField,orderDirection);
		pager= c_T_Sys_FileTypeService.selectList(c_T_Sys_FileType,pager,moduleName);
		return SUCCESS;
	}
	/**
	 * 查询List
	 * @return
	 */
	public  String fileTypeLists() 
	{
		list_C_T_Sys_FileType = c_T_Sys_FileTypeService.selectLists(c_T_Sys_FileType,moduleName);
		return SUCCESS;
	}
	/**
	 * 删除
	 * @return
	 */
	public String fileTypeDel()
	{
		int i=c_T_Sys_FileTypeService.delete(checkIds);
		if(i>0)
		return ajaxForwardSuccess(getText("msg.operation.success"), "fileTypeList","", "forward", "projectmanagement/fileTypeList?moduleName=project");
		return ajaxForwardError(getText("msg.operation.failure"));
	}
	//跳转到新建页面
	public String fileTypeAdd()
	{
		if(c_T_Sys_FileType==null){
			c_T_Sys_FileType=c_T_Sys_FileTypeService.selectOne("");
		}else{
			c_T_Sys_FileType=c_T_Sys_FileTypeService.selectOne(c_T_Sys_FileType.getFiletypeId());
		}
		return SUCCESS;
		
	}
}
